package sky.service.Impl;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import sky.dao.CountryDAO;
import sky.domain.Country;
import sky.service.CountryService;

import java.util.List;

/**
 * Created with IntelliJ IDEA.
 * User: Gauss
 * Date: 23.04.13
 * Time: 9:59
 * To change this template use File | Settings | File Templates.
 */
@Service
public class CountryServiceImpl implements CountryService {

    @Autowired
    private CountryDAO countryDAO;

    @Override
    @Transactional
    public void addCountry(Country country) {
        countryDAO.addCountry(country);
    }

    @Override
    @Transactional
    public List<Country> listCountry() {
        return countryDAO.listCountry();
    }

    @Override
    @Transactional
    public void removeCountry(Integer id) {
        countryDAO.removeCountry(id);
    }

    @Override
    @Transactional
    public Country getCountryById(Integer id) {
        return countryDAO.getCountryById(id);
    }
}
